<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>addEmployee</title>
</head>
<body>
<%--<form>
    lastname:<input type="text" name="lastName"/><br/>
    email: <input type="text" name="email"><br/>
    Gender:
    男: <input type="radio" value="1" name="gender"/>
    女：<input type="radio" value="0" name="gender">
    <br/>
    部门：<select name="department.id">
    <c:forEach items="${depts}" var="dept">
        <option value="${dept.id}">${dept.departmentName}</option>
    </c:forEach>
</select>
    <br/>
    <input type="submit" value="提交">
</form>--%>
<%
    pageContext.setAttribute("cpt",request.getContextPath());
%>
<form:form action="${cpt}/emp" method="post" modelAttribute="employee">
    lastName:<form:input path="lastName"/><form:errors path="lastName"/> <br/>
    email:<form:input path="email"/><form:errors path="email"/> <br/>
    gender:<br/>
    男：<form:radiobutton path="gender" value="1"/>
    女：<form:radiobutton path="gender" value="0"/>
    <br/>
    birth:<form:input path="birth"/><form:errors path="birth"/> <br/>
    salary:<form:input path="salary"/><form:errors path="salary"/><br/>
    dept:
    <form:select path="department.id" items="${depts}" itemLabel="departmentName" itemValue="id"/><br/>
    <input type="submit" value="保存">
</form:form>
</body>
</html>
